package com.fu.core.util;

import java.util.Random;

/**
 * @author 付龙江
 * @date 2022/1/27 21:45
 */
public class SMSSend {

    // 产品名称：云通信短信API产品，开发者无需替换
    static final String product = "Dysmsapi";
    //产品域名，开发者无需替换
    static final String domain = "dysmsapi.aliyuncs.com";
    // 此处需要替换成开发者自己的accessKey（在阿里云访问控制台寻找）
    static final String accessKeyId = "your accessKeyId";
    static final String accessKeySecret = "your accessKeySecret";
    // 签名
    static final String sign = "your signName";

    /**
     * 生成随机的6位数，短信验证码
     * @return
     */
    public static String getMsgCode() {
        int n = 6;
        StringBuilder code = new StringBuilder();
        Random ran = new Random();
        for (int i = 0; i < n; i++) {
            code.append(Integer.valueOf(ran.nextInt(10)).toString());
        }
        return code.toString();
    }
}
